package com.zsj.juc.thread;

import lombok.extern.slf4j.Slf4j;

/**
 * @author <a href="https://gitee.com/zhengshengjun">zsj</a>
 * @date 2023/12/6.
 */
@Slf4j
public class Test3 {
    public static void main(String[] args) {
        Thread t1 = new Thread(new Runnable() {
            @Override
            public void run() {
                log.debug("running...");
            }
        }, "t1");

        log.debug("{}", t1.getState());
        t1.start();
        //如果一个线程被多次启动 会抛出异常
        t1.start();//IllegalThreadStateException
        log.debug("{}", t1.getState());
    }
}
